package com.jp;

import android.graphics.RectF;


public final class RangeSelectionView2RectFHelper {

    /**
     * 属于左矩形
     */
    public static boolean ownL(RectF l, RectF r, float x) {
        return Math.abs(l.centerX() - x) < Math.abs(r.centerX() - x);

    }

    public static final GenericCallback<IntervalSelector.My, Void, Void, Void> tuningRightSlider = (GenericCallback<IntervalSelector.My, Void, Void, Void>) (my, offsetX, aVoid) -> {
        if (my == null) return null;

        my.mDestRectRight.offsetTo(my.getCoordinateByValue(my.curRValue) - my.rsw / 2f, my.mDestRectRight.top);
        return null;
    };
    public static final GenericCallback<IntervalSelector.My, Void, Void, Void> tuningLeftSlider = (GenericCallback<IntervalSelector.My, Void, Void, Void>) (my, offsetX, aVoid) -> {
        if (my == null) return null;

        my.mDestRect.offsetTo(my.getCoordinateByValue(my.curLValue) - my.lsw / 2f, my.mDestRect.top);
        return null;
    };
}
